home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gigarom 1
/
Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso
/
FILES
/
APP
/
A-D
/
BBEdit 2.2.2.sea
/
BBEdit 2.2.2
/
BBEdit Extensions
/
Sources
/
Concat.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-09-12
|
834b
|
45 lines
#include <Aliases.h>
#include "ExternalInterface.h"
pascal void main(ExternalCallbackBlock *callbacks, WindowPtr w)
{
Handle text, file;
StandardFileReply reply;
Boolean scratch;
short i;
Boolean dispose;
short count;
StandardFileReply **files;
if (callbacks->OpenSeveral(FALSE, &count, &files)) {
text = callbacks->Allocate(0, FALSE);
for (i = 0; i < count; i++) {
reply = (*files)[i];
if (reply.sfFlags & 0x8000)
ResolveAliasFile(&reply.sfFile, TRUE, &scratch, &scratch);
file = callbacks->GetFileText(reply.sfFile.vRefNum, reply.sfFile.parID, reply.sfFile.name,
&dispose);
if (file) {
HandAndHand(file, text);
if (dispose)
DisposHandle(file);
};
};
if (count)
{
w = callbacks->NewDocument();
callbacks->SetWindowContents(w, text);
}
}
}